package lesson2;

/**
 * @author pengjz <br>
 * @version 1.0 <br>
 * @description Task2 <br>
 * @date 2021/10/10 3:59 下午 <br>
 */
public class Task2 {
    public static int solution(int[] A){
        int i = A[0];
        if(A.length >1) {
            for (int j = 1; j < A.length; j++) {
                i ^= A[j];
            }
        }
        return i;
    }

    public static void main(String[] args) {
        System.out.println(solution(new int[] {2,3,2,3,1}));
    }
}
